package com.sakana.regex;

public class demo4 {
    public static void main(String[] args) {
        //判断一个字符串的开始部分和结束部分是否一致，开始部分内部每个字符也需要一致
        //举例 aaa123aaa  bbb456bbb 111789111  &&abc&&
        String regex3="((.)\\2*).+\\1";
        System.out.println("aaa123aaa".matches(regex3));
        System.out.println("bbb456bbb".matches(regex3));
        System.out.println("111789111".matches(regex3));
        System.out.println("&&abc&&".matches(regex3));
    }
}
